package com.example.xftest.service;

import com.example.xftest.entity.User;
import com.example.xftest.mapper.UserDao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserDao userDao;

    @Override
    public List<User> select() {
        return userDao.selectList(null);
    }

    @Override
    public int add(User user) {
        return userDao.insert(user);
    }

    @Override
    public int delete(int id) {
        return userDao.deleteById(id);
    }

    @Override
    public int update(User user) {
        return userDao.updateById(user);
    }
}